﻿using DapperExtensions;
using Logistics.Model;
using Logistics.Model.QueryModel;
using Logistics.Service;
using Logistics.WebApi.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;

namespace Logistics.WebApi.Controllers
{
      [MyAuthority]
    public class WuliuCompanyController : System.Web.Http.ApiController
    {
        private WuLiuCompanyService service = new WuLiuCompanyService();

          /// <summary>
          /// 获取物
          /// </summary>
          /// <param name="query"></param>
          /// <returns></returns>
         [HttpPost]
        public ResponseModel GetList(WLCompanyQuery query)
        {
            var resultmod = new ResponseModel();
            try
            {
                //var list = new List<IPredicate>();
                //if (!string.IsNullOrEmpty(query.CompanyName))
                //    list.Add(Predicates.Field<wuliu_wlcompany_business>(f => f.wuliu_name, Operator.Eq, query.CompanyName));
                //if (!string.IsNullOrEmpty(query.CityId))
                //    list.Add(Predicates.Field<wuliu_wlcompany_business>(f => f.city_id, Operator.Like, query.CityId));
                //var pg = Predicates.Group(GroupOperator.And, list.ToArray()); 
                //resultmod.mod = service.GetList(pg, query.Page, query.PageSize);
                resultmod.InitResultState(StateEnum.Success);
            }
            catch (Exception ex)
            {
                resultmod.InitResultState(ex);
            }
            return resultmod;
        }
    }
}